import React from 'react'
function Comh() {
    const change = (e) => {
        console.log(e)
    }
    const change2 = (e, dd) => {
        console.log(e, dd)
    }
    return (
        <div>
            <div onClick={change}>函数组件事件点击</div>
            <div onClick={(e) => change2(e, '额外参数')}>函数组件事件点击 额外参数</div>
        </div>
    )
}
class ComC extends React.Component {
    change = (e) => {
        console.log(e)
    }
    change2 = (e, dd) => {
        console.log(e, dd)
    }
    render() {
        return (
            <div>
                <div onClick={this.change}>类组件事件点击</div>
                <div onClick={(e) => this.change2(e, '额外参数')}>类组件事件点击 额外参数</div>
            </div>

        )
    }
}
export class Test5 extends React.Component {
    render() {
        return (
            <div className="area">
                <h1>5.事件绑定</h1>
                <Comh />
                <ComC />
            </div>
        )
    }
}